<template>
  <div>
    <van-cell-group inset>
      <van-field
        v-model="user.username"
        required
        label="账号"
        placeholder="请输入用户名"
      />
      <van-field
        v-model="user.password"
        required
        label="密码"
        placeholder="请输入密码"
      />
    </van-cell-group>
    <div class="btn-cont">
      <van-button type="primary" block @click="handleReg">注册</van-button>
    </div>
  </div>
</template>

<script setup lang="ts">
import { reactive } from "vue";
import { userReg } from "../api/user";
const user = reactive({
  username: "wuji",
  password: "123",
});
const handleReg = () => {
  userReg(user);
};
</script>

<style scoped>
.btn-cont {
  padding: 10px;
}
</style>
